| Server IP : 151.101.66.159 / Your IP : 216.73.216.66 Web Server : Flywheel/5.1.0 System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64 User : root ( ) PHP Version : 7.4.33.18 Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wp-content/plugins/file-manager-advanced/application/assets/dist/ |
Upload File : |
/*! For license information please see 608.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunkafm_react_admin=self.webpackChunkafm_react_admin||[]).push([[608],{4608(e,t,n){n.r(t),n.d(t,{default:()=>f});var i=n(6540),o=n(7554),r=n(5688),a=n(4848);function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function r(n,i,o,r){var l=i&&i.prototype instanceof c?i:c,d=Object.create(l.prototype);return s(d,"_invoke",function(n,i,o){var r,l,s,c=0,d=o||[],p=!1,u={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return r=t,l=0,s=e,u.n=n,a}};function f(n,i){for(l=n,s=i,t=0;!p&&c&&!o&&t<d.length;t++){var o,r=d[t],f=u.p,h=r[2];n>3?(o=h===i)&&(s=r[(l=r[4])?5:(l=3,3)],r[4]=r[5]=e):r[0]<=f&&((o=n<2&&f<r[1])?(l=0,u.v=i,u.n=r[1]):f<h&&(o=n<3||r[0]>i||i>h)&&(r[4]=n,r[5]=i,u.n=h,l=0))}if(o||n>1)return a;throw p=!0,i}return function(o,d,h){if(c>1)throw TypeError("Generator is already running");for(p&&1===d&&f(d,h),l=d,s=h;(t=l<2?e:s)||!p;){r||(l?l<3?(l>1&&(u.n=-1),f(l,s)):u.n=s:u.v=s);try{if(c=2,r){if(l||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=r.return)&&t.call(r),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);r=e}else if((t=(p=u.n<0)?s:n.call(i,u))!==a)break}catch(t){r=e,l=1,s=t}finally{c=1}}return{value:t,done:p}}}(n,o,r),!0),d}var a={};function c(){}function d(){}function p(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(s(t={},i,function(){return this}),t),f=p.prototype=c.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return d.prototype=p,s(f,"constructor",p),s(p,"constructor",d),d.displayName="GeneratorFunction",s(p,o,"GeneratorFunction"),s(f),s(f,o,"Generator"),s(f,i,function(){return this}),s(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:r,m:h}})()}function s(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}s=function(e,t,n,i){function r(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},s(e,t,n,i)}function c(e,t,n,i,o,r,a){try{var l=e[r](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(i,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function a(e){c(r,i,o,a,l,"next",e)}function l(e){c(r,i,o,a,l,"throw",e)}a(void 0)})}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r,a,l=[],s=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=r.call(n)).done)&&(l.push(i.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function f(){var e,t,n,s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).onContentReady,c=(0,r.lA)(),u=(null===(e=window.wpApiSettings)||void 0===e?void 0:e.nonce)||(null===(t=window.afmReact)||void 0===t?void 0:t.nonce)||"",f=p((0,i.useState)([]),2),h=f[0],m=f[1],x=p((0,i.useState)(!0),2),g=x[0],y=x[1];(0,i.useEffect)(function(){g||null==s||s()},[g,s]);var v=p((0,i.useState)(1),2),b=v[0],j=v[1],w=p((0,i.useState)(1),2),k=w[0],C=w[1],S=p((0,i.useState)("all"),2),D=S[0],N=S[1],A=p((0,i.useState)(""),2),R=A[0],_=A[1],F=p((0,i.useState)(""),2),P=F[0],T=F[1],I=p((0,i.useState)(null),2),M=I[0],E=I[1],U=(0,i.useRef)(!1);(0,i.useEffect)(function(){if(c&&u){y(!0);var e,t=c.endsWith("/")?c:c+"/";if(t.includes("rest_route=")){var n=t.split("rest_route=")[0]+"rest_route=";if(e="".concat(n,"/file-manager-advanced/v1/file-logs&page=").concat(b,"&per_page=20"),D&&"all"!==D&&(e+="&filter=".concat(encodeURIComponent(D))),R&&"string"==typeof R&&""!==R.trim()){var i=R.split(" - ");if(2===i.length){var o=i[0].trim(),r=i[1].trim();o.match(/^\d{4}-\d{2}-\d{2}$/)&&r.match(/^\d{4}-\d{2}-\d{2}$/)&&(e+="&date_range=".concat(encodeURIComponent(R)))}}}else if(e="".concat(t,"file-manager-advanced/v1/file-logs?page=").concat(b,"&per_page=20"),D&&"all"!==D&&(e+="&filter=".concat(encodeURIComponent(D))),R&&"string"==typeof R&&""!==R.trim()){var a=R.split(" - ");if(2===a.length){var l=a[0].trim(),s=a[1].trim();l.match(/^\d{4}-\d{2}-\d{2}$/)&&s.match(/^\d{4}-\d{2}-\d{2}$/)&&(e+="&date_range=".concat(encodeURIComponent(R)))}}console.log("LogsPanel: Fetching URL:",e,"Root:",c),fetch(e,{credentials:"same-origin",headers:{"X-WP-Nonce":u}}).then(function(e){return e.ok?e.json():(console.error("LogsPanel: Response not OK:",e.status,e.statusText,"Final URL:",e.url),e.text().then(function(t){throw console.error("LogsPanel: Response body:",t),new Error("HTTP ".concat(e.status,": ").concat(e.statusText))}))}).then(function(e){m(e.logs||[]),C(e.total_pages||1),y(!1)}).catch(function(e){console.error("AFM Logs fetch error:",e),y(!1)})}else console.warn("AFM Logs: Missing API root or nonce")},[b,D,R,c,u]);var z=p((0,i.useState)(null),2),L=z[0],O=z[1],W=function(){var e=d(l().m(function e(t){var n,i,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=String(t||"")){e.n=1;break}return e.a(2,!1);case 1:if(e.p=1,!navigator.clipboard||!window.isSecureContext){e.n=3;break}return e.n=2,navigator.clipboard.writeText(n);case 2:return e.a(2,!0);case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.p=5,(i=document.createElement("textarea")).value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.left="-9999px",i.style.opacity="0",document.body.appendChild(i),i.select(),o=document.execCommand("copy"),document.body.removeChild(i),e.a(2,o);case 6:return e.p=6,e.v,e.a(2,!1)}},e,null,[[5,6],[1,4]])}));return function(t){return e.apply(this,arguments)}}(),Y=function(){var e=d(l().m(function e(t,n){return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,W(t);case 1:e.v&&(O(n),setTimeout(function(){return O(null)},2e3));case 2:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),H=function(e){if(!e)return"—";var t=parseInt(e);if(!isNaN(t)&&t>0){var n=new Date(1e3*t);if(!isNaN(n.getTime())){var i=["January","February","March","April","May","June","July","August","September","October","November","December"][n.getMonth()],o=n.getDate(),r=n.getFullYear(),a=n.getHours(),l=n.getMinutes(),s=a>=12?"pm":"am";a=(a%=12)||12;var c=l<10?"0"+l:l;return"".concat(i," ").concat(o,", ").concat(r," ").concat(a,":").concat(c," ").concat(s)}}if("string"==typeof e){var d=new Date(e);if(!isNaN(d.getTime())){var p=["January","February","March","April","May","June","July","August","September","October","November","December"][d.getMonth()],u=d.getDate(),f=d.getFullYear(),h=d.getHours(),m=d.getMinutes(),x=h>=12?"pm":"am";h=(h%=12)||12;var g=m<10?"0"+m:m;return"".concat(p," ").concat(u,", ").concat(f," ").concat(h,":").concat(g," ").concat(x)}if(e.match(/[A-Za-z]+ \d+, \d{4}/))return e}return e};(0,i.useEffect)(function(){if(!g){var e=setTimeout(function(){if(void 0!==window.jQuery&&"function"==typeof window.jQuery.fn.daterangepicker){var e=window.jQuery("#date-range");e.length?e.data("daterangepicker")||(e.daterangepicker({autoUpdateInput:!1}),e.off("cancel.daterangepicker").on("cancel.daterangepicker",function(t,n){e.val(""),_(""),T(""),j(1)}),e.off("apply.daterangepicker").on("apply.daterangepicker",function(t,n){var i=n.startDate.format("MM/DD/YYYY")+" - "+n.endDate.format("MM/DD/YYYY"),o=n.startDate.format("YYYY-MM-DD")+" - "+n.endDate.format("YYYY-MM-DD");e.val(i),T(i),_(o),j(1)}),U.current=!0,console.log("Date picker initialized")):console.warn("Date range input not found")}else console.warn("jQuery or daterangepicker not available")},200);return function(){clearTimeout(e)}}},[g]),(0,i.useEffect)(function(){if(R){var e=R.split(" - ");if(2===e.length){var t=e[0].trim().split("-"),n=e[1].trim().split("-");if(3===t.length&&3===n.length){var i="".concat(t[1],"/").concat(t[2],"/").concat(t[0]," - ").concat(n[1],"/").concat(n[2],"/").concat(n[0]);T(i)}}}else T("")},[R]);var B,G=(null===(n=window.afmReact)||void 0===n?void 0:n.hasPro)||!1,J=G?h:[{id:1001,user:"admin",email:"admin@example.com",time:(B=Math.floor(Date.now()/1e3))-3600,event:"Uploaded",file_path:"/wp-content/uploads/2024/11/demo-image.jpg",type:"Image",ip:"192.168.1.100"},{id:1002,user:"editor",email:"editor@example.com",time:B-7200,event:"Deleted",file_path:"/wp-content/uploads/old-document.pdf",type:"Document",ip:"192.168.1.101"},{id:1003,user:"admin",email:"admin@example.com",time:B-10800,event:"Created",file_path:"/wp-content/uploads/new-folder/",type:"Folder",ip:"192.168.1.100"},{id:1004,user:"author",email:"author@example.com",time:B-14400,event:"Renamed",file_path:"/wp-content/uploads/renamed-file.txt",type:"Text",ip:"192.168.1.102"},{id:1005,user:"admin",email:"admin@example.com",time:B-18e3,event:"Duplicated",file_path:"/wp-content/uploads/copy-of-file.png",type:"Image",ip:"192.168.1.100"},{id:1006,user:"editor",email:"editor@example.com",time:B-21600,event:"Pasted",file_path:"/wp-content/uploads/pasted-content.zip",type:"Archive",ip:"192.168.1.101"},{id:1007,user:"admin",email:"admin@example.com",time:B-25200,event:"Updated",file_path:"/wp-content/uploads/updated-file.css",type:"Code",ip:"192.168.1.100"},{id:1008,user:"author",email:"author@example.com",time:B-28800,event:"Uploaded",file_path:"/wp-content/uploads/video-sample.mp4",type:"Video",ip:"192.168.1.102"},{id:1009,user:"editor",email:"editor@example.com",time:B-32400,event:"Created",file_path:"/wp-content/uploads/archive-folder/",type:"Folder",ip:"192.168.1.101"},{id:1010,user:"admin",email:"admin@example.com",time:B-36e3,event:"Deleted",file_path:"/wp-content/uploads/temp-file.tmp",type:"Other",ip:"192.168.1.100"}],X=!G;return g?(0,a.jsxs)("div",{className:"afm-tab-panel",style:{padding:"20px"},children:[(0,a.jsx)("style",{children:"\n @keyframes afm-skeleton-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n .afm-skeleton {\n background-color: #e2e8f0;\n background-image: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);\n background-size: 200% 100%;\n animation: afm-skeleton-shimmer 1.4s linear infinite;\n }\n "}),(0,a.jsxs)("div",{style:{background:"#fff",border:"1px solid #ccc",padding:"20px"},children:[(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"26px",width:"180px",borderRadius:"6px",marginBottom:"18px"}}),(0,a.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"16px",flexWrap:"wrap"},children:[(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"36px",width:"140px",borderRadius:"6px"}}),(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"36px",width:"200px",borderRadius:"6px"}}),(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"36px",width:"120px",borderRadius:"6px"}})]}),[1,2,3,4,5].map(function(e){return(0,a.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"80px 1fr 180px 120px 60px",gap:"10px",marginBottom:"10px"},children:[(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"14px",borderRadius:"4px"}}),(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"14px",borderRadius:"4px"}}),(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"14px",borderRadius:"4px"}}),(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"14px",borderRadius:"4px"}}),(0,a.jsx)("div",{className:"afm-skeleton",style:{height:"14px",borderRadius:"4px"}})]},e)})]})]}):(0,a.jsx)("div",{className:"afm-tab-panel",children:(0,a.jsxs)("div",{className:"wrap",style:{background:"#fff",padding:"20px",border:"1px solid #ccc",position:"relative"},children:[(0,a.jsxs)(o.A,{shouldShow:X,children:[(0,a.jsx)("h2",{style:{marginBottom:"20px"},children:"File Logs"}),(0,a.jsxs)("div",{className:"afm-filter-bar",children:[(0,a.jsxs)("select",{value:D,onChange:function(e){return N(e.target.value)},style:{padding:"0 30px 0 12px",border:"1px solid #ddd",borderRadius:"4px",fontSize:"14px",height:"36px",lineHeight:"36px",minWidth:"130px",verticalAlign:"middle",backgroundColor:"#fff",backgroundImage:'url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%233F6972%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E")',backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center",backgroundSize:"10px",cursor:"pointer",WebkitAppearance:"none",MozAppearance:"none",appearance:"none"},children:[(0,a.jsx)("option",{value:"all",children:"All"}),(0,a.jsx)("option",{value:"uploaded",children:"Uploaded"}),(0,a.jsx)("option",{value:"created",children:"Created"}),(0,a.jsx)("option",{value:"deleted",children:"Deleted"}),(0,a.jsx)("option",{value:"renamed",children:"Renamed"}),(0,a.jsx)("option",{value:"duplicated",children:"Duplicated"}),(0,a.jsx)("option",{value:"pasted",children:"Pasted"}),(0,a.jsx)("option",{value:"updated",children:"Updated"})]}),(0,a.jsx)("input",{type:"text",placeholder:"Date Range",className:"afmp__input",style:{padding:"0 12px",border:"1px solid #ddd",borderRadius:"4px",fontSize:"14px",cursor:"pointer",height:"36px",lineHeight:"34px",verticalAlign:"middle"},id:"date-range",autoComplete:"off",readOnly:!0,value:P}),(0,a.jsx)("button",{type:"button",onClick:function(){N("all"),_(""),T(""),j(1)},className:"button button-secondary",style:{padding:"0 12px",fontSize:"14px",backgroundColor:"#3F6972",color:"#fff",borderColor:"#3F6972",height:"36px",lineHeight:"34px",verticalAlign:"middle",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:"Reset Filters"}),(0,a.jsx)("button",{type:"button",onClick:function(){if(window.confirm("Are you sure you want to delete ALL file logs? This action cannot be undone.")){var e=c.endsWith("/")?c:c+"/";fetch("".concat(e,"file-manager-advanced/v1/file-logs/all"),{method:"DELETE",credentials:"same-origin",headers:{"X-WP-Nonce":u}}).then(function(e){return e.json()}).then(function(e){e.success&&(m([]),j(1),C(1))}).catch(function(e){return console.error("AFM Logs delete all error:",e)})}},disabled:X,className:"button button-secondary",style:{padding:"0 12px",fontSize:"14px",backgroundColor:X?"#999":"#dc3232",color:"#fff",borderColor:X?"#999":"#dc3232",cursor:X?"not-allowed":"pointer",opacity:X?.5:1,height:"36px",lineHeight:"34px",verticalAlign:"middle",display:"inline-flex",alignItems:"center",justifyContent:"center"},title:X?"Pro feature - Upgrade to unlock":"Delete all logs",children:"Delete All"})]}),(0,a.jsx)("div",{className:"afm-table-wrapper",children:(0,a.jsxs)("table",{className:"wp-list-table widefat fixed striped afm-logs-table",style:{width:"100%",tableLayout:"auto"},children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{scope:"col",style:{padding:"10px 6px",width:"50px",minWidth:"50px"},children:"ID"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px 6px",width:"180px",minWidth:"150px"},children:"User"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px"},children:"Date & Time"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px"},children:"Event"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px"},children:"File Path"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px"},children:"Type"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px"},children:"IP Address"}),(0,a.jsx)("th",{scope:"col",style:{padding:"10px"},children:"Actions"})]})}),(0,a.jsx)("tbody",{children:0===J.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"8",style:{padding:"20px",color:"#666",textAlign:"center"},children:"No logs found."})}):J.map(function(e){return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{style:{padding:"10px 6px",width:"50px",minWidth:"50px"},children:e.id}),(0,a.jsxs)("td",{style:{padding:"10px 6px",width:"180px",minWidth:"150px"},children:[e.user||"—",e.email&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),e.email]})]}),(0,a.jsx)("td",{style:{padding:"10px"},children:H(e.time)||"—"}),(0,a.jsx)("td",{style:{padding:"10px"},children:e.event||"—"}),(0,a.jsx)("td",{style:{padding:"10px",maxWidth:"300px"},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginRight:"8px"},title:e.file_path,children:e.file_path||"—"}),e.file_path&&(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("button",{onClick:function(){return Y(e.file_path,e.id)},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",flexShrink:0},title:"Copy file path",children:(0,a.jsx)("span",{className:L===e.id?"dashicons dashicons-yes":"dashicons dashicons-admin-page",style:{fontSize:"16px",lineHeight:"1",color:L===e.id?"#46b450":"inherit"}})}),L===e.id&&(0,a.jsx)("span",{style:{position:"absolute",bottom:"100%",right:"50%",transform:"translateX(50%)",background:"#333",color:"#fff",padding:"4px 8px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap",marginBottom:"5px",zIndex:10},children:"Copied!"})]})]})}),(0,a.jsx)("td",{style:{padding:"10px"},children:e.type||"—"}),(0,a.jsx)("td",{style:{padding:"10px"},children:e.ip||"—"}),(0,a.jsx)("td",{style:{padding:"10px"},children:(0,a.jsx)("div",{style:{display:"flex",gap:"8px"},children:X?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{disabled:!0,style:{background:"none",border:"none",cursor:"not-allowed",padding:"4px",color:"#999",opacity:.5},title:"View details (Pro feature)",children:(0,a.jsx)("span",{className:"dashicons dashicons-visibility",style:{fontSize:"16px",lineHeight:"1"}})}),(0,a.jsx)("button",{disabled:!0,style:{background:"none",border:"none",cursor:"not-allowed",padding:"4px",color:"#999",opacity:.5},title:"Delete log (Pro feature)",children:(0,a.jsx)("span",{className:"dashicons dashicons-trash",style:{fontSize:"16px",lineHeight:"1"}})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:function(){return E(e)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#2271b1"},title:"View details",children:(0,a.jsx)("span",{className:"dashicons dashicons-visibility",style:{fontSize:"16px",lineHeight:"1"}})}),(0,a.jsx)("button",{onClick:function(){return function(e){if(window.confirm("Are you sure you want to delete this file log?")){var t=c.endsWith("/")?c:c+"/";fetch("".concat(t,"file-manager-advanced/v1/file-logs/").concat(e),{method:"DELETE",credentials:"same-origin",headers:{"X-WP-Nonce":u}}).then(function(e){return e.json()}).then(function(e){if(e.success){var t=c.endsWith("/")?c:c+"/",n="".concat(t,"file-manager-advanced/v1/file-logs?page=").concat(b,"&per_page=20");return D&&"all"!==D&&(n+="&filter=".concat(encodeURIComponent(D))),R&&(n+="&date_range=".concat(encodeURIComponent(R))),fetch(n,{credentials:"same-origin",headers:{"X-WP-Nonce":u}})}}).then(function(e){return e.ok?e.json():null}).then(function(e){e&&(m(e.logs||[]),C(e.total_pages||1))}).catch(function(e){return console.error("AFM Logs delete error:",e)})}}(e.id)},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#d63638"},title:"Delete log",children:(0,a.jsx)("span",{className:"dashicons dashicons-trash",style:{fontSize:"16px",lineHeight:"1"}})})]})})})]},e.id)})})]})})]}),!X&&k>1&&(0,a.jsxs)("div",{style:{marginTop:"20px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)("button",{disabled:1===b,onClick:function(){return j(b-1)},className:"button",children:"Previous"}),(0,a.jsxs)("span",{style:{padding:"0 10px"},children:["Page ",b," of ",k]}),(0,a.jsx)("button",{disabled:b>=k,onClick:function(){return j(b+1)},className:"button",children:"Next"})]}),M&&(0,a.jsx)("div",{style:{position:"fixed",inset:"0",background:"rgba(0,0,0,.4)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:function(){return E(null)},children:(0,a.jsxs)("div",{style:{background:"#fff",borderRadius:"8px",minWidth:"400px",maxWidth:"600px",width:"90%",padding:"20px"},onClick:function(e){return e.stopPropagation()},children:[(0,a.jsx)("h3",{style:{marginTop:"0"},children:"Log Detail"}),(0,a.jsx)("p",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:M.message||"No details available."}),(0,a.jsx)("button",{onClick:function(){return E(null)},className:"button button-primary",style:{marginTop:"15px"},children:"Close"})]})})]})})}},5688(e,t,n){function i(){var e,t;return function(e){if(!e||"string"!=typeof e)return e;try{var t=new URL(e,window.location.origin);return t.protocol=window.location.protocol,t.host=window.location.host,t.toString()}catch(t){return e.startsWith("/")?"".concat(window.location.origin).concat(e):e}}((null===(e=window.wpApiSettings)||void 0===e?void 0:e.root)||(null===(t=window.afmReact)||void 0===t?void 0:t.jsonURL)||"/wp-json/")}n.d(t,{lA:()=>i})}}]);
//# sourceMappingURL=608.chunk.js.map